<template>
	<view class="centent">
		<view class="search-box">
			<u-search :clearabled="true" shape="round" :show-action="true" @search="showToast()"></u-search>
		</view>
		<view class="search-box-index"></view>
		<view class="u-page">
			<u-list @scrolltolower="scrolltolower">
				<u-list-item v-for="(item, index) in indexList" :key="index" class="u-list-item">
					<u-cell :title="`系统消息-${index + 1}`" @click="showToast()" label="描述信息按时间大理石雕刻叫阿三的拉横幅阿里开发"
						class="u-cell">
						<u-avatar slot="icon" shape="square" size="40" :src="item.url"
							customStyle="margin: -3px 5px -3px 0" class="u-avatar"></u-avatar>
					</u-cell>
				</u-list-item>
			</u-list>
		</view>

	</view>
</template>

<script>
	export default {
		data() {
			return {
				indexList: [],
				urls: [
					'../../static/userphoto/A_1.png',
					'../../static/userphoto/A_2.png',
					'../../static/userphoto/A_3.png',
					'../../static/userphoto/A_4.png',
					'../../static/userphoto/A_5.png',
					'../../static/userphoto/A_6.png',
					'../../static/userphoto/A_7.png',
					'../../static/userphoto/A_8.png',
					'../../static/userphoto/A_10.png',
					'../../static/userphoto/A_11.png',

				]
			}
		},
		onLoad() {
			this.loadmore()
		},
		methods: {
			showToast(msg) {
				uni.showToast({
					title: '功能暂未开通，敬请期待' + msg,
					duration: 2000,
					icon: "success"
				})
			},
			scrolltolower() {
				this.loadmore()
			},
			loadmore() {

				for (let i = 0; i < 30; i++) {
					this.indexList.push({
						url: this.urls[uni.$u.random(0, this.urls.length - 1)]
					})
				}
			}
		}
	}
</script>

<style lang="scss" scoped>
	@import "message.scss";
</style>
